<?php

//$_GET['path'] & $_GET['flag']
	session_start();
		$toFlag = '-1';
	if ($_GET['flag'] == 1)
		$toFlag = '0';
	else $toFlag = '1';
	
	$conn =  mysql_connect("localhost", "vandes4_root", 'root');

 	if($conn){
		 	
		$db=mysql_select_db('vandes4_PROJECT', $conn);
 		if($db)	{

			$query = "UPDATE users SET admin = ".$toFlag." WHERE username = '".$_GET['path']."'";
			$run = mysql_query($query) or die(mysql_error());
			
			$_SESSION['atad'] = $toFlag;
			
			echo $_SESSION['atad'];			

		}
		
	}


?>
